package com.kkks.spring_rest.tick.model;

import java.util.Date;

import javax.persistence.Column;
import javax.persistence.FetchType;
import javax.persistence.GeneratedValue;
import javax.persistence.Id;
import javax.persistence.JoinColumn;
import javax.persistence.MappedSuperclass;
import javax.persistence.OneToOne;
import javax.persistence.PrimaryKeyJoinColumn;
import javax.persistence.Temporal;
import javax.persistence.TemporalType;


/**
 * AbstractWhoUsers entity provides the base persistence definition of the
 * WhoUsers entity. @author MyEclipse Persistence Tools
 */
@MappedSuperclass
public abstract class AbstractWhoUsers implements java.io.Serializable {

	// Fields

	private Integer userId;
	private String email;
	private String userName;
	private String avatar;
	private String question;
	private String answer;
	private Boolean sex;
	private Date birthday;
	private Integer addressId;
	private Short userRank;
	private Integer parentId;
	private String alias;
	private String msn;
	private String officePhone;
	private String homePhone;
	private String mobilePhone;
	private Short isValidated;
	private Double creditLine;
	private String yahoo;
	private String skype;
	private String country;
	private Integer isGoogle;
	private Short wishShow;
	private Short goodsComment;

	
	/**
     * @OneToOne：一对一关联
      * cascade：级联,它可以有有五个值可选,分别是：
      * CascadeType.PERSIST：级联新建
      * CascadeType.REMOVE : 级联删除
      * CascadeType.REFRESH：级联刷新
      * CascadeType.MERGE  ： 级联更新
      * CascadeType.ALL    ： 以上全部四项
      * @JoinColumn:主表外键字段
      * @PrimaryKeyJoinColumn 共享主键
      */

	
	private WhoUserBaseInfo whoUserBaseInfo;
	
	
//	private WhoUserAddress whoUserAddresses;
	
	
	// Constructors
//	@OneToOne(cascade = javax.persistence.CascadeType.ALL )
//	@JoinColumn(name = "address_id", insertable = false, updatable = false)
//	public WhoUserAddress getWhoUserAddresses() {
//		return whoUserAddresses;
//	}
//
//	public void setWhoUserAddresses(WhoUserAddress whoUserAddresses) {
//		this.whoUserAddresses = whoUserAddresses;
//	}
	@OneToOne(cascade = javax.persistence.CascadeType.ALL )
	@PrimaryKeyJoinColumn
	public WhoUserBaseInfo getWhoUserBaseInfo() {
		return whoUserBaseInfo;
	}

	public void setWhoUserBaseInfo(WhoUserBaseInfo whoUserBaseInfo) {
		this.whoUserBaseInfo = whoUserBaseInfo;
	}

	/** default constructor */
	public AbstractWhoUsers() {
	}

	/** minimal constructor */
	public AbstractWhoUsers(String email, String userName, String avatar,
			String question, String answer, Boolean sex, Date birthday,
			Integer addressId, Short userRank, Integer parentId, String alias,
			String msn, String officePhone, String homePhone,
			String mobilePhone, Short isValidated, Double creditLine,
			String yahoo, String skype, String country, Integer isGoogle) {
		this.email = email;
		this.userName = userName;
		this.avatar = avatar;
		this.question = question;
		this.answer = answer;
		this.sex = sex;
		this.birthday = birthday;
		this.addressId = addressId;
		this.userRank = userRank;
		this.parentId = parentId;
		this.alias = alias;
		this.msn = msn;
		this.officePhone = officePhone;
		this.homePhone = homePhone;
		this.mobilePhone = mobilePhone;
		this.isValidated = isValidated;
		this.creditLine = creditLine;
		this.yahoo = yahoo;
		this.skype = skype;
		this.country = country;
		this.isGoogle = isGoogle;
	}

	/** full constructor */
	public AbstractWhoUsers(String email, String userName, String avatar,
			String question, String answer, Boolean sex, Date birthday,
			Integer addressId, Short userRank, Integer parentId, String alias,
			String msn, String officePhone, String homePhone,
			String mobilePhone, Short isValidated, Double creditLine,
			String yahoo, String skype, String country, Integer isGoogle,
			Short wishShow, Short goodsComment) {
		this.email = email;
		this.userName = userName;
		this.avatar = avatar;
		this.question = question;
		this.answer = answer;
		this.sex = sex;
		this.birthday = birthday;
		this.addressId = addressId;
		this.userRank = userRank;
		this.parentId = parentId;
		this.alias = alias;
		this.msn = msn;
		this.officePhone = officePhone;
		this.homePhone = homePhone;
		this.mobilePhone = mobilePhone;
		this.isValidated = isValidated;
		this.creditLine = creditLine;
		this.yahoo = yahoo;
		this.skype = skype;
		this.country = country;
		this.isGoogle = isGoogle;
		this.wishShow = wishShow;
		this.goodsComment = goodsComment;
	}

	// Property accessors
	@Id
	@GeneratedValue
	@Column(name = "user_id", unique = true, nullable = false)
	public Integer getUserId() {
		return this.userId;
	}

	public void setUserId(Integer userId) {
		this.userId = userId;
	}

	@Column(name = "email", nullable = false, length = 60)
	public String getEmail() {
		return this.email;
	}

	public void setEmail(String email) {
		this.email = email;
	}

	@Column(name = "user_name", nullable = false, length = 60)
	public String getUserName() {
		return this.userName;
	}

	public void setUserName(String userName) {
		this.userName = userName;
	}

	@Column(name = "avatar", nullable = false, length = 60)
	public String getAvatar() {
		return this.avatar;
	}

	public void setAvatar(String avatar) {
		this.avatar = avatar;
	}

	@Column(name = "question", nullable = false)
	public String getQuestion() {
		return this.question;
	}

	public void setQuestion(String question) {
		this.question = question;
	}

	@Column(name = "answer", nullable = false)
	public String getAnswer() {
		return this.answer;
	}

	public void setAnswer(String answer) {
		this.answer = answer;
	}

	@Column(name = "sex", nullable = false)
	public Boolean getSex() {
		return this.sex;
	}

	public void setSex(Boolean sex) {
		this.sex = sex;
	}

	@Temporal(TemporalType.DATE)
	@Column(name = "birthday", nullable = false, length = 10)
	public Date getBirthday() {
		return this.birthday;
	}

	public void setBirthday(Date birthday) {
		this.birthday = birthday;
	}

	@Column(name = "address_id", nullable = false)
	public Integer getAddressId() {
		return this.addressId;
	}

	public void setAddressId(Integer addressId) {
		this.addressId = addressId;
	}

	@Column(name = "user_rank", nullable = false)
	public Short getUserRank() {
		return this.userRank;
	}

	public void setUserRank(Short userRank) {
		this.userRank = userRank;
	}

	@Column(name = "parent_id", nullable = false)
	public Integer getParentId() {
		return this.parentId;
	}

	public void setParentId(Integer parentId) {
		this.parentId = parentId;
	}

	@Column(name = "alias", nullable = false, length = 60)
	public String getAlias() {
		return this.alias;
	}

	public void setAlias(String alias) {
		this.alias = alias;
	}

	@Column(name = "msn", nullable = false, length = 60)
	public String getMsn() {
		return this.msn;
	}

	public void setMsn(String msn) {
		this.msn = msn;
	}

	@Column(name = "office_phone", nullable = false, length = 20)
	public String getOfficePhone() {
		return this.officePhone;
	}

	public void setOfficePhone(String officePhone) {
		this.officePhone = officePhone;
	}

	@Column(name = "home_phone", nullable = false, length = 20)
	public String getHomePhone() {
		return this.homePhone;
	}

	public void setHomePhone(String homePhone) {
		this.homePhone = homePhone;
	}

	@Column(name = "mobile_phone", nullable = false, length = 20)
	public String getMobilePhone() {
		return this.mobilePhone;
	}

	public void setMobilePhone(String mobilePhone) {
		this.mobilePhone = mobilePhone;
	}

	@Column(name = "is_validated", nullable = false)
	public Short getIsValidated() {
		return this.isValidated;
	}

	public void setIsValidated(Short isValidated) {
		this.isValidated = isValidated;
	}

	@Column(name = "credit_line", nullable = false, precision = 10)
	public Double getCreditLine() {
		return this.creditLine;
	}

	public void setCreditLine(Double creditLine) {
		this.creditLine = creditLine;
	}

	@Column(name = "yahoo", nullable = false, length = 60)
	public String getYahoo() {
		return this.yahoo;
	}

	public void setYahoo(String yahoo) {
		this.yahoo = yahoo;
	}

	@Column(name = "skype", nullable = false, length = 60)
	public String getSkype() {
		return this.skype;
	}

	public void setSkype(String skype) {
		this.skype = skype;
	}

	@Column(name = "country", nullable = false, length = 200)
	public String getCountry() {
		return this.country;
	}

	public void setCountry(String country) {
		this.country = country;
	}

	@Column(name = "is_google", nullable = false)
	public Integer getIsGoogle() {
		return this.isGoogle;
	}

	public void setIsGoogle(Integer isGoogle) {
		this.isGoogle = isGoogle;
	}

	@Column(name = "wish_show")
	public Short getWishShow() {
		return this.wishShow;
	}

	public void setWishShow(Short wishShow) {
		this.wishShow = wishShow;
	}

	@Column(name = "goods_comment")
	public Short getGoodsComment() {
		return this.goodsComment;
	}

	public void setGoodsComment(Short goodsComment) {
		this.goodsComment = goodsComment;
	}

}